#include <php.h>
#include "timing.h"

//timing

PHP_FUNCTION(millis)
{
    long ret = millis();
    RETURN_LONG(ret);
}

PHP_FUNCTION(micros)
{
    long ret = micros();
    RETURN_LONG(ret);
}

PHP_FUNCTION(delay)
{
    zend_long howLong;

	ZEND_PARSE_PARAMETERS_START(1, 1)
		Z_PARAM_LONG(howLong)
	ZEND_PARSE_PARAMETERS_END();

    delay(howLong);
}

PHP_FUNCTION(delayMicroseconds)
{
    zend_long howLong;

	ZEND_PARSE_PARAMETERS_START(1, 1)
		Z_PARAM_LONG(howLong)
	ZEND_PARSE_PARAMETERS_END();

    delayMicroseconds(howLong);
}

//end for timing